home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / sgels.z / sgels
Encoding:
Text File  |  2002-10-03  |  6.3 KB  |  199 lines

  1.  
  2.  
  3.  
  4. SSSSGGGGEEEELLLLSSSS((((3333SSSS))))                                                            SSSSGGGGEEEELLLLSSSS((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SGELS - solve overdetermined or underdetermined real linear systems
  10.      involving an M-by-N matrix A, or its transpose, using a QR or LQ
  11.      factorization of A
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      SUBROUTINE SGELS( TRANS, M, N, NRHS, A, LDA, B, LDB, WORK, LWORK, INFO )
  15.  
  16.          CHARACTER     TRANS
  17.  
  18.          INTEGER       INFO, LDA, LDB, LWORK, M, N, NRHS
  19.  
  20.          REAL          A( LDA, * ), B( LDB, * ), WORK( * )
  21.  
  22. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  23.      These routines are part of the SCSL Scientific Library and can be loaded
  24.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  25.      directs the linker to use the multi-processor version of the library.
  26.  
  27.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  28.      4 bytes (32 bits). Another version of SCSL is available in which integers
  29.      are 8 bytes (64 bits).  This version allows the user access to larger
  30.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  31.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  32.      only one of the two versions; 4-byte integer and 8-byte integer library
  33.      calls cannot be mixed.
  34.  
  35. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  36.      SGELS solves overdetermined or underdetermined real linear systems
  37.      involving an M-by-N matrix A, or its transpose, using a QR or LQ
  38.      factorization of A. It is assumed that A has full rank. The following
  39.      options are provided:
  40.  
  41.      1. If TRANS = 'N' and m >= n:  find the least squares solution of
  42.         an overdetermined system, i.e., solve the least squares problem
  43.                      minimize || B - A*X ||.
  44.  
  45.      2. If TRANS = 'N' and m < n:  find the minimum norm solution of
  46.         an underdetermined system A * X = B.
  47.  
  48.      3. If TRANS = 'T' and m >= n:  find the minimum norm solution of
  49.         an undetermined system A**T * X = B.
  50.  
  51.      4. If TRANS = 'T' and m < n:  find the least squares solution of
  52.         an overdetermined system, i.e., solve the least squares problem
  53.                      minimize || B - A**T * X ||.
  54.  
  55.      Several right hand side vectors b and solution vectors x can be handled
  56.      in a single call; they are stored as the columns of the M-by-NRHS right
  57.      hand side matrix B and the N-by-NRHS solution matrix X.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSGGGGEEEELLLLSSSS((((3333SSSS))))                                                            SSSSGGGGEEEELLLLSSSS((((3333SSSS))))
  71.  
  72.  
  73.  
  74. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  75.      TRANS   (input) CHARACTER
  76.              = 'N': the linear system involves A;
  77.              = 'T': the linear system involves A**T.
  78.  
  79.      M       (input) INTEGER
  80.              The number of rows of the matrix A.  M >= 0.
  81.  
  82.      N       (input) INTEGER
  83.              The number of columns of the matrix A.  N >= 0.
  84.  
  85.      NRHS    (input) INTEGER
  86.              The number of right hand sides, i.e., the number of columns of
  87.              the matrices B and X. NRHS >=0.
  88.  
  89.      A       (input/output) REAL array, dimension (LDA,N)
  90.              On entry, the M-by-N matrix A.  On exit, if M >= N, A is
  91.              overwritten by details of its QR factorization as returned by
  92.              SGEQRF; if M <  N, A is overwritten by details of its LQ
  93.              factorization as returned by SGELQF.
  94.  
  95.      LDA     (input) INTEGER
  96.              The leading dimension of the array A.  LDA >= max(1,M).
  97.  
  98.      B       (input/output) REAL array, dimension (LDB,NRHS)
  99.              On entry, the matrix B of right hand side vectors, stored
  100.              columnwise; B is M-by-NRHS if TRANS = 'N', or N-by-NRHS if TRANS
  101.              = 'T'. On exit, B is overwritten by the solution vectors, stored
  102.              columnwise:  if TRANS = 'N' and m >= n, rows 1 to n of B contain
  103.              the least squares solution vectors; the residual sum of squares
  104.              for the solution in each column is given by the sum of squares of
  105.              elements N+1 to M in that column; if TRANS = 'N' and m < n, rows
  106.              1 to N of B contain the minimum norm solution vectors; if TRANS =
  107.              'T' and m >= n, rows 1 to M of B contain the minimum norm
  108.              solution vectors; if TRANS = 'T' and m < n, rows 1 to M of B
  109.              contain the least squares solution vectors; the residual sum of
  110.              squares for the solution in each column is given by the sum of
  111.              squares of elements M+1 to N in that column.
  112.  
  113.      LDB     (input) INTEGER
  114.              The leading dimension of the array B. LDB >= MAX(1,M,N).
  115.  
  116.      WORK    (workspace/output) REAL array, dimension (LWORK)
  117.              On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  118.  
  119.      LWORK   (input) INTEGER
  120.              The dimension of the array WORK.  LWORK >= max( 1, MN + max( MN,
  121.              NRHS ) ).  For optimal performance, LWORK >= max( 1, MN + max(
  122.              MN, NRHS )*NB ).  where MN = min(M,N) and NB is the optimum block
  123.              size.
  124.  
  125.              If LWORK = -1, then a workspace query is assumed; the routine
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSGGGGEEEELLLLSSSS((((3333SSSS))))                                                            SSSSGGGGEEEELLLLSSSS((((3333SSSS))))
  137.  
  138.  
  139.  
  140.              only calculates the optimal size of the WORK array, returns this
  141.              value as the first entry of the WORK array, and no error message
  142.              related to LWORK is issued by XERBLA.
  143.  
  144.      INFO    (output) INTEGER
  145.              = 0:  successful exit
  146.              < 0:  if INFO = -i, the i-th argument had an illegal value
  147.  
  148. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  149.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  150.  
  151.      This man page is available only online.
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.